package org.momo.rpc.service;


import org.momo.rpc.annotion.RateLimit;
import org.momo.rpc.annotion.Retry;
import org.momo.rpc.api.UserService;
import org.momo.rpc.api.model.User;
import org.momo.rpc.constant.RateLimitKey;
import org.momo.rpc.springboot.starter.annotion.RpcService;
import org.springframework.stereotype.Service;


@Service
@RpcService(serviceName = "user", serviceVersion = "v1.0")
public class UserServiceImpl implements UserService {

    @Override
    @RateLimit(type = RateLimitKey.TOKEN)
    @Retry
    public User queryUserById(Long id) {
        return new User(id, "test");
    }

}
